.class public Lcom/estrongs/android/ui/dlna/dialog/RequestCastScreenToTVActivityDialog;
.super Lcom/estrongs/android/pop/esclasses/ESActivity;
.source "RequestCastScreenToTVActivityDialog.java"


# instance fields
.field private d:Lcom/estrongs/android/ui/view/MaxWidthLinearLayout;

.field private e:Landroid/widget/ImageView;

.field private f:Landroid/widget/LinearLayout;

.field private g:Landroid/view/View;

.field private h:Landroid/widget/Button;

.field private i:Landroid/widget/Button;

.field private j:Landroid/widget/TextView;

.field private k:Landroid/widget/TextView;

.field public l:Lcom/estrongs/android/pop/app/filetransfer/server/a;

.field private m:Ljava/lang/String;


# direct methods
.method public constructor <init>()V
    .locals 0

    .line 1
    invoke-direct {p0}, Lcom/estrongs/android/pop/esclasses/ESActivity;-><init>()V

    return-void
.end method

.method private A()V
    .locals 1

    .line 1
    iget-object v0, p0, Lcom/estrongs/android/ui/dlna/dialog/RequestCastScreenToTVActivityDialog;->m:Ljava/lang/String;

    if-nez v0, :cond_0

    return-void

    .line 2
    :cond_0
    invoke-static {v0}, Lcom/estrongs/android/dlna/ESMediaPlayers;->play(Ljava/lang/String;)V

    .line 3
    invoke-virtual {p0}, Lcom/estrongs/android/ui/dlna/dialog/RequestCastScreenToTVActivityDialog;->finish()V

    return-void
.end method

.method private B()V
    .locals 3

    .line 1
    invoke-virtual {p0}, Landroid/app/Activity;->getPackageResourcePath()Ljava/lang/String;

    move-result-object v0

    .line 2
    new-instance v1, Lcom/estrongs/android/pop/app/filetransfer/server/a;

    const/16 v2, 0x1f90

    invoke-direct {v1, v0, v2}, Lcom/estrongs/android/pop/app/filetransfer/server/a;-><init>(Ljava/lang/String;I)V

    iput-object v1, p0, Lcom/estrongs/android/ui/dlna/dialog/RequestCastScreenToTVActivityDialog;->l:Lcom/estrongs/android/pop/app/filetransfer/server/a;

    .line 3
    :try_start_0
    invoke-virtual {v1}, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;->b()V
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception v0

    .line 4
    invoke-virtual {v0}, Ljava/io/IOException;->printStackTrace()V

    :goto_0
    return-void
.end method

.method private C()V
    .locals 1

    .line 1
    iget-object v0, p0, Lcom/estrongs/android/ui/dlna/dialog/RequestCastScreenToTVActivityDialog;->l:Lcom/estrongs/android/pop/app/filetransfer/server/a;

    if-eqz v0, :cond_0

    .line 2
    invoke-virtual {v0}, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;->c()V

    :cond_0
    return-void
.end method

.method static synthetic a(Lcom/estrongs/android/ui/dlna/dialog/RequestCastScreenToTVActivityDialog;I)V
    .locals 0

    .line 1
    invoke-direct {p0, p1}, Lcom/estrongs/android/ui/dlna/dialog/RequestCastScreenToTVActivityDialog;->h(I)V

    return-void
.end method

.method private a(Lcom/estrongs/android/ui/view/MaxWidthLinearLayout;)V
    .locals 4

    .line 2
    invoke-virtual {p0}, Landroid/app/Activity;->getIntent()Landroid/content/Intent;

    move-result-object v0

    const-string v1, "is_es_device"

    const/4 v2, 0x1

    .line 3
    invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z

    move-result v1

    const-string v2, "device_name"

    .line 4
    invoke-virtual {v0, v2}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    const-string v3, "device_play_uri"

    .line 5
    invoke-virtual {v0, v3}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/estrongs/android/ui/dlna/dialog/RequestCastScreenToTVActivityDialog;->m:Ljava/lang/String;

    const v0, 0x7f0909aa

    .line 6
    invoke-virtual {p1, v0}, Landroid/widget/LinearLayout;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/LinearLayout;

    iput-object v0, p0, Lcom/estrongs/android/ui/dlna/dialog/RequestCastScreenToTVActivityDialog;->f:Landroid/widget/LinearLayout;

    const v0, 0x7f090be2

    .line 7
    invoke-virtual {p1, v0}, Landroid/widget/LinearLayout;->findViewById(I)Landroid/view/View;

    move-result-object v0

    iput-object v0, p0, Lcom/estrongs/android/ui/dlna/dialog/RequestCastScreenToTVActivityDialog;->g:Landroid/view/View;

    const v0, 0x7f09024c

    .line 8
    invoke-virtual {p1, v0}, Landroid/widget/LinearLayout;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/TextView;

    iput-object v0, p0, Lcom/estrongs/android/ui/dlna/dialog/RequestCastScreenToTVActivityDialog;->j:Landroid/widget/TextView;

    const v0, 0x7f0902fb

    .line 9
    invoke-virtual {p1, v0}, Landroid/widget/LinearLayout;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/TextView;

    iput-object v0, p0, Lcom/estrongs/android/ui/dlna/dialog/RequestCastScreenToTVActivityDialog;->k:Landroid/widget/TextView;

    .line 10
    iget-object v0, p0, Lcom/estrongs/android/ui/dlna/dialog/RequestCastScreenToTVActivityDialog;->j:Landroid/widget/TextView;

    invoke-virtual {p0, v2}, Lcom/estrongs/android/ui/dlna/dialog/RequestCastScreenToTVActivityDialog;->c(Ljava/lang/String;)Ljava/lang/CharSequence;

    move-result-object v2

    invoke-virtual {v0, v2}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    if-eqz v1, :cond_0

    .line 11
    iget-object v0, p0, Lcom/estrongs/android/ui/dlna/dialog/RequestCastScreenToTVActivityDialog;->g:Landroid/view/View;

    const/16 v1, 0x8

    invoke-virtual {v0, v1}, Landroid/view/View;->setVisibility(I)V

    .line 12
    iget-object v0, p0, Lcom/estrongs/android/ui/dlna/dialog/RequestCastScreenToTVActivityDialog;->f:Landroid/widget/LinearLayout;

    invoke-virtual {v0, v1}, Landroid/widget/LinearLayout;->setVisibility(I)V

    :cond_0
    const/16 v0, 0x1f90

    .line 13
    invoke-direct {p0, v0}, Lcom/estrongs/android/ui/dlna/dialog/RequestCastScreenToTVActivityDialog;->i(I)Ljava/lang/String;

    move-result-object v0

    .line 14
    iget-object v1, p0, Lcom/estrongs/android/ui/dlna/dialog/RequestCastScreenToTVActivityDialog;->k:Landroid/widget/TextView;

    invoke-virtual {v1, v0}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    const v1, 0x7f0908a0

    .line 15
    invoke-virtual {p1, v1}, Landroid/widget/LinearLayout;->findViewById(I)Landroid/view/View;

    move-result-object v1

    check-cast v1, Landroid/widget/ImageView;

    iput-object v1, p0, Lcom/estrongs/android/ui/dlna/dialog/RequestCastScreenToTVActivityDialog;->e:Landroid/widget/ImageView;

    .line 16
    invoke-direct {p0, v0}, Lcom/estrongs/android/ui/dlna/dialog/RequestCastScreenToTVActivityDialog;->d(Ljava/lang/String;)Landroid/graphics/Bitmap;

    move-result-object v0

    if-eqz v0, :cond_1

    .line 17
    iget-object v1, p0, Lcom/estrongs/android/ui/dlna/dialog/RequestCastScreenToTVActivityDialog;->e:Landroid/widget/ImageView;

    invoke-virtual {v1, v0}, Landroid/widget/ImageView;->setImageBitmap(Landroid/graphics/Bitmap;)V

    .line 18
    :cond_1
    new-instance v0, Lcom/estrongs/android/ui/dlna/dialog/RequestCastScreenToTVActivityDialog$a;

    invoke-direct {v0, p0}, Lcom/estrongs/android/ui/dlna/dialog/RequestCastScreenToTVActivityDialog$a;-><init>(Lcom/estrongs/android/ui/dlna/dialog/RequestCastScreenToTVActivityDialog;)V

    const v1, 0x7f09082d

    .line 19
    invoke-virtual {p1, v1}, Landroid/widget/LinearLayout;->findViewById(I)Landroid/view/View;

    move-result-object v1

    check-cast v1, Landroid/widget/Button;

    iput-object v1, p0, Lcom/estrongs/android/ui/dlna/dialog/RequestCastScreenToTVActivityDialog;->i:Landroid/widget/Button;

    const v1, 0x7f090915

    .line 20
    invoke-virtual {p1, v1}, Landroid/widget/LinearLayout;->findViewById(I)Landroid/view/View;

    move-result-object p1

    check-cast p1, Landroid/widget/Button;

    iput-object p1, p0, Lcom/estrongs/android/ui/dlna/dialog/RequestCastScreenToTVActivityDialog;->h:Landroid/widget/Button;

    .line 21
    iget-object p1, p0, Lcom/estrongs/android/ui/dlna/dialog/RequestCastScreenToTVActivityDialog;->i:Landroid/widget/Button;

    invoke-virtual {p1, v0}, Landroid/widget/Button;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 22
    iget-object p1, p0, Lcom/estrongs/android/ui/dlna/dialog/RequestCastScreenToTVActivityDialog;->h:Landroid/widget/Button;

    invoke-virtual {p1, v0}, Landroid/widget/Button;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    return-void
.end method

.method public static a(ZLjava/lang/String;Ljava/lang/String;)V
    .locals 4

    .line 23
    :try_start_0
    invoke-static {}, Lcom/estrongs/android/pop/esclasses/ESActivity;->z()Landroid/app/Activity;

    move-result-object v0
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    const-string v1, "is_es_device"

    if-eqz v0, :cond_0

    .line 24
    :try_start_1
    new-instance v2, Landroid/content/Intent;

    const-class v3, Lcom/estrongs/android/ui/dlna/dialog/RequestCastScreenToTVActivityDialog;

    invoke-direct {v2, v0, v3}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    .line 25
    invoke-virtual {v2, v1, p0}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Z)Landroid/content/Intent;

    const-string p0, "device_name"

    .line 26
    invoke-virtual {v2, p0, p1}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    const-string p0, "device_play_uri"

    .line 27
    invoke-virtual {v2, p0, p2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    .line 28
    invoke-virtual {v0, v2}, Landroid/app/Activity;->startActivity(Landroid/content/Intent;)V

    goto :goto_0

    .line 29
    :cond_0
    new-instance p1, Landroid/content/Intent;

    invoke-static {}, Lcom/estrongs/android/pop/FexApplication;->n()Lcom/estrongs/android/pop/FexApplication;

    move-result-object p2

    const-class v0, Lcom/estrongs/android/ui/dlna/dialog/RequestCastScreenToTVActivityDialog;

    invoke-direct {p1, p2, v0}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    .line 30
    invoke-virtual {p1, v1, p0}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Z)Landroid/content/Intent;

    const p0, 0x10008000

    .line 31
    invoke-virtual {p1, p0}, Landroid/content/Intent;->addFlags(I)Landroid/content/Intent;

    .line 32
    invoke-static {}, Lcom/estrongs/android/pop/FexApplication;->n()Lcom/estrongs/android/pop/FexApplication;

    move-result-object p0

    invoke-virtual {p0, p1}, Landroid/app/Application;->startActivity(Landroid/content/Intent;)V

    .line 33
    :goto_0
    invoke-static {}, Lcom/estrongs/android/statistics/b;->b()Lcom/estrongs/android/statistics/b;

    move-result-object p0

    const-string p1, "device_connect_dialog_show"

    invoke-virtual {p0, p1}, Lcom/estrongs/android/statistics/b;->d(Ljava/lang/String;)V
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0

    goto :goto_1

    :catch_0
    move-exception p0

    .line 34
    invoke-virtual {p0}, Ljava/lang/Exception;->printStackTrace()V

    :goto_1
    return-void
.end method

.method private d(Ljava/lang/String;)Landroid/graphics/Bitmap;
    .locals 3

    const v0, 0x7f0700fa

    .line 1
    invoke-static {p0, v0}, Lcom/estrongs/android/pop/utils/t;->a(Landroid/content/Context;I)I

    move-result v1

    .line 2
    invoke-static {p0, v0}, Lcom/estrongs/android/pop/utils/t;->a(Landroid/content/Context;I)I

    move-result v0

    const-string v2, "0"

    .line 3
    invoke-static {p1, v1, v0, v2}, Lcom/estrongs/android/util/i0;->a(Ljava/lang/String;IILjava/lang/String;)Landroid/graphics/Bitmap;

    move-result-object p1

    return-object p1
.end method

.method private h(I)V
    .locals 1

    const v0, 0x7f09082d

    if-eq p1, v0, :cond_1

    const v0, 0x7f090915

    if-eq p1, v0, :cond_0

    goto :goto_0

    .line 1
    :cond_0
    invoke-static {}, Lcom/estrongs/android/dlna/c;->g()Lcom/estrongs/android/dlna/c;

    move-result-object p1

    invoke-virtual {p1}, Lcom/estrongs/android/dlna/c;->a()V

    .line 2
    invoke-direct {p0}, Lcom/estrongs/android/ui/dlna/dialog/RequestCastScreenToTVActivityDialog;->A()V

    goto :goto_0

    .line 3
    :cond_1
    invoke-static {}, Lcom/estrongs/android/dlna/c;->g()Lcom/estrongs/android/dlna/c;

    move-result-object p1

    invoke-virtual {p1}, Lcom/estrongs/android/dlna/c;->e()V

    .line 4
    invoke-virtual {p0}, Lcom/estrongs/android/ui/dlna/dialog/RequestCastScreenToTVActivityDialog;->finish()V

    :goto_0
    return-void
.end method

.method private i(I)Ljava/lang/String;
    .locals 3

    .line 1
    invoke-static {}, Lcom/estrongs/android/util/f0;->b()Ljava/lang/String;

    move-result-object v0

    const/4 v1, 0x2

    new-array v1, v1, [Ljava/lang/Object;

    const/4 v2, 0x0

    aput-object v0, v1, v2

    .line 2
    invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object p1

    const/4 v0, 0x1

    aput-object p1, v1, v0

    const-string p1, "%s:%d"

    invoke-static {p1, v1}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object p1

    return-object p1
.end method


# virtual methods
.method public c(Ljava/lang/String;)Ljava/lang/CharSequence;
    .locals 5

    .line 1
    invoke-static {}, Les/n10;->c()Ljava/lang/String;

    move-result-object v0

    const v1, 0x7f1104d8

    .line 2
    invoke-virtual {p0, v1}, Landroid/app/Activity;->getString(I)Ljava/lang/String;

    move-result-object v1

    const v2, 0x7f1104e1

    .line 3
    invoke-virtual {p0, v2}, Landroid/app/Activity;->getString(I)Ljava/lang/String;

    move-result-object v2

    const/4 v3, 0x4

    new-array v3, v3, [Ljava/lang/Object;

    const/4 v4, 0x0

    aput-object v2, v3, v4

    const/4 v2, 0x1

    aput-object v0, v3, v2

    const/4 v0, 0x2

    aput-object v1, v3, v0

    const/4 v0, 0x3

    aput-object p1, v3, v0

    const-string p1, "%s %s / %s %s"

    .line 4
    invoke-static {p1, v3}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object p1

    return-object p1
.end method

.method public finish()V
    .locals 1

    .line 1
    invoke-super {p0}, Landroid/app/Activity;->finish()V

    const/4 v0, 0x0

    .line 2
    invoke-virtual {p0, v0, v0}, Landroid/app/Activity;->overridePendingTransition(II)V

    .line 3
    invoke-direct {p0}, Lcom/estrongs/android/ui/dlna/dialog/RequestCastScreenToTVActivityDialog;->C()V

    return-void
.end method

.method public onBackPressed()V
    .locals 1

    .line 1
    invoke-super {p0}, Landroidx/activity/ComponentActivity;->onBackPressed()V

    .line 2
    invoke-static {}, Lcom/estrongs/android/dlna/c;->g()Lcom/estrongs/android/dlna/c;

    move-result-object v0

    invoke-virtual {v0}, Lcom/estrongs/android/dlna/c;->e()V

    return-void
.end method

.method public onCreate(Landroid/os/Bundle;)V
    .locals 3

    .line 1
    invoke-super {p0, p1}, Lcom/estrongs/android/pop/esclasses/ESActivity;->onCreate(Landroid/os/Bundle;)V

    const/4 p1, 0x1

    .line 2
    invoke-virtual {p0, p1}, Landroidx/appcompat/app/AppCompatActivity;->supportRequestWindowFeature(I)Z

    .line 3
    invoke-virtual {p0}, Landroid/app/Activity;->getWindow()Landroid/view/Window;

    move-result-object v0

    const v1, 0x7f08012a

    .line 4
    invoke-virtual {v0, v1}, Landroid/view/Window;->setBackgroundDrawableResource(I)V

    .line 5
    invoke-static {p0}, Lcom/estrongs/android/pop/esclasses/h;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;

    move-result-object v0

    const v1, 0x7f0c00f4

    const/4 v2, 0x0

    .line 6
    invoke-virtual {v0, v1, v2}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object v0

    check-cast v0, Lcom/estrongs/android/ui/view/MaxWidthLinearLayout;

    iput-object v0, p0, Lcom/estrongs/android/ui/dlna/dialog/RequestCastScreenToTVActivityDialog;->d:Lcom/estrongs/android/ui/view/MaxWidthLinearLayout;

    .line 7
    invoke-virtual {p0}, Lcom/estrongs/android/pop/esclasses/ESActivity;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    invoke-virtual {v0}, Landroid/content/res/Resources;->getConfiguration()Landroid/content/res/Configuration;

    move-result-object v0

    iget v0, v0, Landroid/content/res/Configuration;->orientation:I

    if-ne v0, p1, :cond_0

    goto :goto_0

    :cond_0
    const/4 p1, 0x0

    .line 8
    :goto_0
    iget-object v0, p0, Lcom/estrongs/android/ui/dlna/dialog/RequestCastScreenToTVActivityDialog;->d:Lcom/estrongs/android/ui/view/MaxWidthLinearLayout;

    invoke-virtual {p0, v0}, Landroidx/appcompat/app/AppCompatActivity;->setContentView(Landroid/view/View;)V

    if-nez p1, :cond_3

    .line 9
    invoke-static {}, Lcom/estrongs/android/util/o0;->d()Z

    move-result p1

    if-eqz p1, :cond_1

    .line 10
    invoke-virtual {p0}, Lcom/estrongs/android/pop/esclasses/ESActivity;->getResources()Landroid/content/res/Resources;

    move-result-object p1

    invoke-virtual {p1}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics;

    move-result-object p1

    iget p1, p1, Landroid/util/DisplayMetrics;->widthPixels:I

    mul-int/lit8 p1, p1, 0x3

    .line 11
    div-int/lit8 p1, p1, 0x4

    goto :goto_1

    .line 12
    :cond_1
    invoke-virtual {p0}, Lcom/estrongs/android/pop/esclasses/ESActivity;->getResources()Landroid/content/res/Resources;

    move-result-object p1

    invoke-virtual {p1}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics;

    move-result-object p1

    iget p1, p1, Landroid/util/DisplayMetrics;->heightPixels:I

    .line 13
    invoke-static {p0}, Lcom/estrongs/android/pop/utils/t;->i(Landroid/content/Context;)Z

    move-result v0

    if-eqz v0, :cond_2

    mul-int/lit8 p1, p1, 0x4

    .line 14
    div-int/lit8 p1, p1, 0x5

    .line 15
    :cond_2
    :goto_1
    iget-object v0, p0, Lcom/estrongs/android/ui/dlna/dialog/RequestCastScreenToTVActivityDialog;->d:Lcom/estrongs/android/ui/view/MaxWidthLinearLayout;

    invoke-virtual {v0, p1}, Lcom/estrongs/android/ui/view/MaxWidthLinearLayout;->setMaxWidth(I)V

    goto :goto_2

    .line 16
    :cond_3
    invoke-virtual {p0}, Lcom/estrongs/android/pop/esclasses/ESActivity;->getResources()Landroid/content/res/Resources;

    move-result-object p1

    invoke-virtual {p1}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics;

    move-result-object p1

    iget p1, p1, Landroid/util/DisplayMetrics;->widthPixels:I

    .line 17
    invoke-static {p0}, Lcom/estrongs/android/pop/utils/t;->i(Landroid/content/Context;)Z

    move-result v0

    if-eqz v0, :cond_4

    mul-int/lit8 p1, p1, 0x4

    .line 18
    div-int/lit8 p1, p1, 0x5

    .line 19
    :cond_4
    iget-object v0, p0, Lcom/estrongs/android/ui/dlna/dialog/RequestCastScreenToTVActivityDialog;->d:Lcom/estrongs/android/ui/view/MaxWidthLinearLayout;

    invoke-virtual {v0, p1}, Lcom/estrongs/android/ui/view/MaxWidthLinearLayout;->setMaxWidth(I)V

    .line 20
    :goto_2
    iget-object p1, p0, Lcom/estrongs/android/ui/dlna/dialog/RequestCastScreenToTVActivityDialog;->d:Lcom/estrongs/android/ui/view/MaxWidthLinearLayout;

    invoke-direct {p0, p1}, Lcom/estrongs/android/ui/dlna/dialog/RequestCastScreenToTVActivityDialog;->a(Lcom/estrongs/android/ui/view/MaxWidthLinearLayout;)V

    .line 21
    invoke-direct {p0}, Lcom/estrongs/android/ui/dlna/dialog/RequestCastScreenToTVActivityDialog;->B()V

    return-void
.end method
